package com.bruan.d5_objectoutputstream;

import java.io.Serializable;

//实现序列化接口 通知虚拟机
public class User implements Serializable {
    private String name;
    private String username;
    private int age;
    private transient String password;//transient取消序列化
    public User() {
    }

    public User(String name, String username, int age, String password) {
        this.name = name;
        this.username = username;
        this.age = age;
        this.password = password;
    }

    @Override
    public String toString() {
        return "User{" +
                "name='" + name + '\'' +
                ", username='" + username + '\'' +
                ", age=" + age +
                ", password='" + password + '\'' +
                '}';
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }



}
